package ex_from_web;


	class PrintClass {
	    //Methods have same name but different signature (parameters)
	    void print(double number) {
	        System.out.println("This is double number: " + number);
	    }
	    
	    void print(int number) {
	        System.out.println("This is int number: " + number);
	    }
	    
	    void print(byte letter) {
	        System.out.println("This is byte number: " + letter);
	    }
	    
	    void print(char letter) {
	        System.out.println("This is char number: " + letter);
	    }
	    void print(String text) {
	        System.out.println("This is string: " + text);
	    }
	    
	    void print(float text) {
	        System.out.println("This is float: " + text);
	    }
	}

	public class polymorphism {

	    public static void main(String[] args) {
	        PrintClass p = new PrintClass();
	        //We call same method with different kind of parameters
	        //compiler will know which method will call depends on
	        //match between parameters provided and method signature
	        p.print(3);
	        p.print('A');
	        p.print(4.55F);
	        p.print("Hello");
	        p.print(850.315D);
	    }

	}
